$(function () {

    //登录验证
    $("form").validate({
        rules:{
            utel:"required",
            upwd:"required"
        },
        messages: {
            utel: {
                required:"请输入用户名"
            },
            upwd:{
                required:"请输入密码"
            }
        },
        submitHandler:function () {

            $.post("http://127.0.0.1:8080/zhongjiu/server/login.php",$("form").serialize(),function (res) {
                if (res.status==1){
                    confirm("登录成功,是否现在去主页")?window.location="index.html":"";
                }else {
                    alert(res.msg);
                }
            }, "json")
            return false;
        }
    })
})